﻿CREATE TABLE [dbo].[ComprasArticulos] (
    [IdCompraArticulo]     INT             IDENTITY (1, 1) NOT NULL,
    [IdCompra]             INT             NOT NULL,
    [IdArticuloExistencia] INT             NOT NULL,
    [Precio]               DECIMAL (19, 4) NOT NULL,
    [Iva]                  DECIMAL (19, 4) NOT NULL,
    [Impuesto]             DECIMAL (19, 4) NOT NULL,
    [DescuentoRecargo]     DECIMAL (19, 4) NOT NULL,
    CONSTRAINT [PK_ComprasArticulos] PRIMARY KEY CLUSTERED ([IdCompraArticulo] ASC),
    CONSTRAINT [FK_ComprasArticulos_ArticulosExistencias] FOREIGN KEY ([IdArticuloExistencia]) REFERENCES [dbo].[ArticulosExistencias] ([IdArticuloExistencia]),
    CONSTRAINT [FK_ComprasArticulos_Compras] FOREIGN KEY ([IdCompra]) REFERENCES [dbo].[Compras] ([IdCompra])
);



